﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LojaVirtual.Comuns.Produtos;
using System.Data.Entity.ModelConfiguration;
using LojaVirtual.Comuns.Clientes;

namespace LojaVirtual.Infra.Mapeamentos
{
	class CompraConfiguration : EntityTypeConfiguration<Compra>
	{
		public CompraConfiguration()
		{
			ToTable("Compras");
			HasKey(c => c.ID);

			Ignore(c => c.Total);

			HasRequired(c => c.Cliente)
			.WithMany(p => p.Compras)
			.Map(x => x.MapKey("ClienteID"));
		}
	}
}
